﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using UnityEngine;
using UBlockly.Graphic;
using UBlockly;
using UBlockly.Scriptable;
using UBlockly.UI;

//using ARMan;

public class CodingDefineMono : MonoBehaviour, IBlockApi
{
    public int[] BarItems
    {
        get { return new int[] {0}; }
    }
    
    [BlockDescribe(0, "等待")]
    public VoidR WaitTime(IntR t)
    {
        VoidR result = VoidR.Default();
        
        result.ContinueCallback();
        return result;
    }

//    [BlockDescribe(0, "等待ggg")]
//    public VoidR WWtest(IntR a, IntR b, IntR c, IntR d, IntR e, IntR f)
//    {
//        VoidR result = VoidR.Default();
//        return result;
//    }

    public VoidR eee(Queue<IVarObject> paramQue)
    {
        IntR a = paramQue.Dequeue() as IntR;
        IntR b = paramQue.Dequeue() as IntR;
        IntR1 c = paramQue.Dequeue() as IntR1;
        VoidR result = VoidR.Default();
        Debug.Log($"sum = {a.Value + b.Value + c.Value}");
        return result;
    }
    [BlockDescribe(0,"武汉加油")]
    public IntR JiaYou()
    {
        IntR result = new IntR();
        return result;
    }

    [BlockDescribe(0,"加油")]
    public IntR jjj(IntR t)
    {
        IntR result = new IntR();
        
        return result;
    }
    [BlockDescribe(0, "隐藏")]
    public VoidR HideSelf()
    {
        VoidR result = VoidR.Default();
        result.ContinueCallback();
        return result;
    }
    [BlockDescribe(0, "走")]
    public VoidR Walk(IntR time)
    {
        VoidR result = VoidR.Default();
        result.ContinueCallback();
        return result;
    }

    [BlockDescribe(0,"测试IntR","","dd")]
    public IntR1 TestIntR(IntR intr_1,IntR intr_2)
    {
        var r = new IntR1() {Value = (intr_1.Value + intr_2.Value)};
        Debug.Log("TestIntR result "+r.Value);
        return (IntR1)r;
    }

    [BlockDescribe(0,"测11","")]
    public VoidR TestVoidR1(IntR x_1)
    {
        Debug.Log("show intr:"+x_1.Value);
        var result = VoidR.Default();
        result.ContinueCallback();
        //CoroutineFuntion.DelayAction(0.5f, result.ContinueCallback);
        return result;
    }

    [BlockDescribe(0,"测22","")]
    public VoidR TestVoidR2(IntR x)
    {
        return VoidR.Default();
    }

    [BlockDescribe(0,"测33","","IntR1")]
    public VoidR TestVoidR3(IntR x, IntR y)
    {
        return VoidR.Default();
    }
}